home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / GBLVARS.H < prev    next >
C/C++ Source or Header  |  1988-10-21  |  16KB  |  378 lines

  1. /* -*-C-*- gblvars.h */
  2. /*-->gblvars*/
  3. /**********************************************************************/
  4. /****************************** gblvars *******************************/
  5. /**********************************************************************/
  6.  
  7. /**********************************************************************/
  8. /*********************  General Global Variables  *********************/
  9. /**********************************************************************/
  10.  
  11. char curpath[MAXFNAME];            /* current file area */
  12. char curext[MAXFNAME];            /* current file extension */
  13. char curname[MAXFNAME];            /* current file name */
  14.  
  15. UNSIGN16 debug_code;            /* 0 for no debug output */
  16.  
  17. char dviname[MAXFNAME];            /* DVI filespec */
  18. char dvoname[MAXFNAME];            /* device output filespec */
  19.  
  20. char fontlist[MAXSTR];            /* FONTLIST environment string */
  21. char fontpath[MAXFNAME];        /* font directory path */
  22.  
  23. char helpcmd[MAXSTR];            /* where to look for help */
  24.  
  25. char message[MAXMSG];            /* for formatting error messages */
  26.  
  27. /***********************************************************************
  28. Magnification table for 144dpi, 200dpi, and 300dpi devices, computed
  29. to 20 figures and sorted by magnitude.
  30.  
  31.     Column 1         Column 2         Column 3
  32. 0.72*sqrt(1.2)**i  sqrt(1.2)**I  1.5*sqrt(1.2)**I    (I = -16,16)
  33.  
  34. ***********************************************************************/
  35.  
  36. /*  original full list
  37. static float mag_table[] =
  38.     {
  39.         0.16744898601451165028, 0.18343117374303022733, 0.20093878321741398034,
  40.         0.22011740849163627280, 0.23256803936137783874, 0.24112653986089677641,
  41.         0.25476552262595201888, 0.26414089018996352736, 0.27908164723365340649,
  42.         0.28935184783307613169, 0.30571862715114242265, 0.31696906822795623283,
  43.         0.33489797668038408779, 0.34722221739969135802, 0.34885205904206675812,
  44.         0.36686235258137090718, 0.38036288187354747940, 0.38214828393892802832,
  45.         0.40187757201646090535, 0.41666666087962962963, 0.41862247085048010974,
  46.         0.44023482309764508862, 0.45643545824825697527, 0.45857794072671363398,
  47.         0.48225308641975308642, 0.49999999305555555556, 0.50234696502057613169,
  48.         0.52828178771717410634, 0.54772254989790837033, 0.55029352887205636077,
  49.         0.57870370370370370370, 0.59999999166666666667, 0.60281635802469135802,
  50.         0.63393814526060892761, 0.65726705987749004440, 0.66035223464646763293,
  51.         0.69444444444444444444, 0.71999999000000000000, 0.72337962962962962963,
  52.         0.76072577431273071313, 0.78872047185298805327, 0.79242268157576115952,
  53.         0.83333333333333333333, 0.86399998800000000000, 0.86805555555555555556,
  54.         0.91287092917527685576, 0.94646456622358566393, 0.95090721789091339142,
  55.         1.00000000000000000000, 1.03679998560000000000, 1.04166666666666666670,
  56.         1.09544511501033222690, 1.13575747946830279670, 1.14108866146909606970,
  57.         1.20000000000000000000, 1.24415998272000000000, 1.25000000000000000000,
  58.         1.31453413801239867230, 1.36290897536196335610, 1.36930639376291528360,
  59.         1.44000000000000000000, 1.49299197926400000000, 1.50000000000000000000,
  60.     1.57744096561487840680, 1.63549077043435602730, 1.64316767251549834040,
  61.     1.72800000000000000000, 1.79159037511680000000, 1.80000000000000000000,
  62.     1.89292915873785408810, 1.96258892452122723270, 1.97180120701859800840,
  63.     2.07360000000000000000, 2.14990845014016000000, 2.16000000000000000000,
  64.     2.27151499048542490570, 2.35510670942547267930, 2.36616144842231761010,
  65.     2.48832000000000000000, 2.57989014016819200000, 2.59200000000000000000,
  66.     2.72581798858250988690, 2.82612805131056721510, 2.83939373810678113220,
  67.     2.98598400000000000000, 3.09586816820183040000, 3.11040000000000000000,
  68.     3.27098158629901186430, 3.40727248572813735860, 3.58318080000000000000,
  69.     3.73248000000000000000, 3.92517790355881423710, 4.08872698287376483030,
  70.     4.29981696000000000000, 4.47897600000000000000, 4.90647237944851779640,
  71.     5.37477120000000000000, 5.88776685533822135560, 6.44972544000000000000
  72.     };
  73.  
  74. */
  75.  
  76. static float mag_table[] =
  77.     {
  78.  0.27908164723365340649,
  79.  0.31696906822795623283,
  80.  0.34885205904206675812,
  81.  0.38214828393892802832,
  82.  0.41862247085048010974,
  83.  0.45857794072671363398,
  84.  0.50234696502057613169,
  85.  0.55029352887205636077,
  86.  0.60281635802469135802,
  87.  0.66035223464646763293,
  88.  0.72337962962962962963,
  89.  0.79242268157576115952,
  90.  0.83333333333333333333,
  91.  0.86805555555555555556,
  92.  0.91287092917527685576,
  93.  0.95090721789091339142,
  94.  1.00000000000000000000,
  95.  1.04166666666666666670,
  96.  1.09544511501033222690,
  97.  1.14108866146909606970,
  98.  1.20000000000000000000,
  99.  1.25000000000000000000,
  100.  1.31453413801239867230,
  101.  1.36930639376291528360,
  102.  1.44000000000000000000,
  103.  1.50000000000000000000,
  104.  1.57744096561487840680,
  105.  1.64316767251549834040,
  106.  1.72800000000000000000,
  107.  1.80000000000000000000,
  108.  2.07360000000000000000,
  109.  2.16000000000000000000,
  110.  2.48832000000000000000,
  111.  2.59200000000000000000,
  112.  2.98598400000000000000,
  113.  3.11040000000000000000,
  114.  3.73248000000000000000, 
  115.  4.47897600000000000000, 
  116.  5.37477120000000000000,
  117.  5.88776685533822135560    };
  118.  
  119.  
  120.  
  121. INT16 mag_index;        /* set by actfact */
  122.  
  123. #define MAGTABSIZE (sizeof(mag_table) / sizeof(float))
  124.  
  125. int g_errenc = 0;        /* has an error been encountered?      */
  126. char g_logname[MAXSTR];        /* name of log file, if created          */
  127. BOOLEAN g_dolog = TRUE;        /* allow log file creation          */
  128. FILE *g_logfp = (FILE*)NULL;    /* log file pointer (for errors)      */
  129. char g_progname[MAXSTR];    /* program name                  */
  130.  
  131. FILE *plotfp = (FILE*)NULL;    /* plot file pointer              */
  132.  
  133. struct char_entry
  134. {                /* character entry              */
  135.    COORDINATE wp, hp;        /* width and height in pixels          */
  136.    COORDINATE xoffp, yoffp;    /* x offset and y offset in pixels      */
  137.    long fontrp;            /* font file raster pointer          */
  138.    UNSIGN32 tfmw;        /* TFM width                  */
  139.    INT32 dx, dy;        /* character escapements          */
  140.    UNSIGN16 pxlw;        /* pixel width == round(TFM width in      */
  141.                 /* pixels for .PXL files, or          */
  142.                 /* float(char_dx)/65536.0 for .GF and .PK */
  143.                 /* files)                  */
  144.    INT16 refcount;        /* reference count for memory management  */
  145.    UNSIGN32 *rasters;        /* raster description (dynamically loaded) */
  146.  
  147. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  148.    BOOLEAN isloaded;        /* is the character already downloaded?   */
  149. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  150.  
  151. #if    HPJETPLUS
  152.    BOOLEAN istoobig;        /* Too big (or too odd) to be loaded */
  153. #endif
  154.  
  155. #if    CANON_A2
  156.    BOOLEAN isknown;        /* Character is known */
  157.    BOOLEAN istoobig;        /* Too big to be loaded */
  158. #endif
  159.  
  160. #if    BBNBITGRAPH
  161.    BOOLEAN istoobig;        /* is the character too big for BitGraph? */
  162.    BOOLEAN isloaded;        /* is the character loaded in the BitGraph?*/
  163.    INT16 bgfont, bgchar;    /* BitGraph font and character          */
  164. #endif /* BBNBITGRAPH */
  165.  
  166. };
  167.  
  168. struct font_entry
  169. {
  170.     struct font_entry *next;    /* pointer to next font entry           */
  171.     void (*charxx)();        /* pointer to chargf(), charpk(), charpxl()*/
  172.     FILE *font_file_id;        /* file identifier (NULL if none)       */
  173.     INT32 k;            /* font number                             */
  174.     UNSIGN32 c;            /* checksum                                */
  175.     UNSIGN32 d;            /* design size                             */
  176.     UNSIGN32 s;            /* scale factor                            */
  177.     INT32 font_space;        /* computed from FNT_DEF s parameter       */
  178.     UNSIGN32 font_mag;        /* computed from FNT_DEF s and d parameters*/
  179.     UNSIGN32 magnification;    /* magnification read from PXL file       */
  180.     UNSIGN32 designsize;    /* design size read from PXL file       */
  181.     UNSIGN32 hppp;        /* horizontal pixels/point * 2**16       */
  182.     UNSIGN32 vppp;        /* vertical pixels/point * 2**16       */
  183.     INT32 min_m;        /* GF bounding box values           */
  184.     INT32 max_m;
  185.     INT32 min_n;
  186.     INT32 max_n;
  187.  
  188. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  189.     UNSIGN16 font_number;    /* font number (0..32767) */
  190. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  191.  
  192. #if    CANON_A2
  193.     COORDINATE cell_w;
  194.     COORDINATE cell_h;
  195.     COORDINATE cell_d;
  196.     UNSIGN16 nloaded;
  197.     UNSIGN32 storage;